import { 
  COUNT,
  THEME,
  SETTING,
  THEMECOLOR,
  LAYOUT,
  FIXSIDE,
  FIXHEADER,
  MULTIPAGE,
  COLORWEAKNESS,
  GRAYNESS,
  HEADERPROGRESS,
  FORBIDANIMATION,
  ANIMATIONTYPE,
  ANIMATIONDIRECTION,
  COLLAPSESTATUS,
  INJECTTRANSITION,
  ACTIVEMENUITEM
} from './types'

// 设置数量
const setCount = (value) => ({
  type: COUNT,
  value
})

// 设置激活菜单项
const setActiveMenuItem = (value) => ({
  type: ACTIVEMENUITEM,
  value
})

// 设置切换抽屉开关
const setSetting = () => ({
  type: SETTING
})

// 设置侧边收缩状态
const setCollapseStatus = () => ({
  type: COLLAPSESTATUS
})

// 设置注入过渡
const setInjectTransition = (bool) => ({
  type: INJECTTRANSITION,
  value: bool
})

// 切换主题风格
const setTheme = (value) => ({
  type: THEME,
  value 
})

// 切换主题颜色
const setThemeColor = (value) => ({
  type: THEMECOLOR,
  value
})

// 切换主题布局
const setLayout = (value) => ({
  type: LAYOUT,
  value
})

// 固定侧边栏位
const fixSider = () => ({
  type: FIXSIDE
})

// 固定头部
const fixHeader = () => ({
  type: FIXHEADER
})

// 多页标签
const multiPage = () => ({
  type: MULTIPAGE
}) 

// 色弱
const setColorWeak = () => ({
  type: COLORWEAKNESS
})

// 灰色模式
const setGray = () => ({
  type: GRAYNESS
})

// 顶部进度条
const setProgress = () => ({
  type: HEADERPROGRESS
})

// 禁用动画
const forbidAnimation = () => ({
  type: FORBIDANIMATION
})

// 选择动画类型
const selectAnimationType = (value) => ({
  type: ANIMATIONTYPE,
  value
})

// 选择动画方向
const selectAnimationDirection = (value) => ({
  type: ANIMATIONDIRECTION,
  value
})

export { 
  setCount,
  setActiveMenuItem,
  setSetting,
  setTheme,
  setThemeColor,
  setLayout,
  fixSider,
  fixHeader,
  multiPage,
  setColorWeak,
  setGray,
  setProgress,
  forbidAnimation,
  selectAnimationType,
  selectAnimationDirection,
  setCollapseStatus,
  setInjectTransition
}